import { createApp } from 'vue'
  // import './style.css'
import App from './App.vue'
import router from './router'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//国际化zhCn，给分页加的
// import { zhCn } from 'element-plus/es/locales.mjs'
import { zhCn } from 'element-plus/es/locales.mjs'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/assets/styles/element-override.scss';
import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persist' 
import myconfirm from './utils/myconfirm'
//权限验证
import './Permissons'
//按键权限
import { permission } from './directive/permission'
import * as echarts from 'echarts'

// createApp(App).mount('#app')
const pinia = createPinia()
pinia.use(piniaPersist)
const app =createApp(App)
app.directive('permission',permission)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
app.use(router).use(ElementPlus,{locale:zhCn}).use(pinia).mount('#app')
//全局属性使用
app.config.globalProperties.$myconfirm = myconfirm
app.config.globalProperties.$echarts = echarts
